<?php
	$sql="SELECT * FROM tbl_news";
	$res=mysql_query($sql);
			
	if(!$res)
		dieN(mysql_error());
?>
<form name="f" method="POST">
	<input type="hidden" name="guid"></input>
	<input type="hidden" name="act"></input>
	<table class='tbl_view'>
		<tr id='first'>
			<td></td>			
			<td><span>Hình minh họa</span></td>
			<td><span>Tiêu đề</span></td>
			<td></td>
		</tr>
		<?php 
		$i=1;
		while($row=mysql_fetch_array($res))
		{
		?>
		<tr>
			<td id='order'>
				<span><?php echo($i++);?></span>				
			</td>			
			<td style='padding:0px;margin:0px;height:0px;width:0px'>
				<?php
					if($row["image"]!="")
					{ 
						$image="images/news/thumbnail/$row[image]";
				?>
				<img src="<?php echo $image;?>"/>
				<?php
					} 
				?>
			</td>	
			<td><?php echo($row["title"]);?></td>
			<td id='manager'>
				<span onclick="f.act.value='update';f.guid.value='<?php echo $row["id"]?>';f.submit();">Sửa</span>
				<span onclick="f.act.value='actionDelete';f.guid.value='<?php echo $row["id"]?>';f.submit();">Xóa</span>
			</td>
		</tr>		
		<?php 
		}
		?>
		<tr id='last'>
			<td colspan='3'>
				<span onclick="f.act.value='insert';f.submit();" style='cursor:pointer'>
					Thêm
				</span>
			</td>
			<td></td>
		</tr>
	</table>
</form>

